翻訳と辞書
Words near each other
・ GNOME Mines
・ GNOME Mobile & Embedded Initiative
・ Gnome Monosoupape
・ Gnome Motion Picture Company
・ Gnome of Girona
・ Gnome Omega
・ GNOME Panel
・ Gnome Press
・ Gnome Ranger
・ Gnome Reserve
・ GNOME Screensaver
・ GNOME Screenshot
・ GNOME Shell
・ Gnome Sigma
・ GNOME Software
Gnome sort
・ GNOME Speech
・ GNOME Storage
・ Gnome Subtitles
・ GNOME System Tools
・ GNOME Terminal
・ GNOME Users And Developers European Conference
・ GNOME Videos
・ Gnome Wave Cleaner
・ Gnome's hat hydroid
・ GNOME-DB
・ Gnome-Rhône 14M
・ Gnome-Rhône 14N
・ Gnome-Rhône 18L
・ Gnome-Rhône 7K


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Gnome sort : ウィキペディア英語版
Gnome sort

Gnome sort (or Stupid sort) is a sorting algorithm originally proposed by Dr. Hamid Sarbazi-Azad (Professor of Computer Engineering at Sharif University of Technology) in 2000 and called "stupid sort" (not to be confused with bogosort), and then later on described by Dick Grune and named "gnome sort" from the observation that it is "how a gnome sorts a line of flower pots."〔http://www.dickgrune.com/Programs/gnomesort.html〕 It is a sorting algorithm which is similar to insertion sort, except that moving an element to its proper place is accomplished by a series of swaps, as in bubble sort. It is conceptually simple, requiring no nested loops. The average, or expected, running time is ''O''(''n''2), but tends towards ''O''(''n'') if the list is initially almost sorted.
The algorithm always finds the first place where two adjacent elements are in the wrong order, and swaps them. It takes advantage of the fact that performing a swap can introduce a new out-of-order adjacent pair only next to the two swapped elements. It does not assume that elements forward of the current position are sorted, so it only needs to check the position directly previous to the swapped elements.
== Description ==
Here is pseudocode for the gnome sort using a zero-based array:

procedure gnomeSort(a)
pos := pos + 1
else
swap a() and a()
if (pos > 1)
pos := pos - 1
end if
end if
end while
end procedure


抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Gnome sort」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.